package objects;

/**
 * 
 * @author Emanuel Martins 5940, Ana Pontes 5950 || date 05/06/2014
 * 
 *         This is the class Map, this class makes a map in a 2D Array and adds
 *         nodes to the map. This class also gets the size of the map and the
 *         grey scale.
 * 
 */

public class Map
{
   private int  width;
   private int  height;
   private int  maxGray;
   private Node matrix[][];

   /**
    * This method makes a map and sets the size of the 2D array (matrix)
    * 
    * @param width
    *           - the width of the map image in pixels
    * @param height
    *           - the height of the map image in pixels
    */

   public Map(int width, int height)
   {
      this.width = width;
      this.height = height;
      this.matrix = new Node[this.width][this.height];
   }

   /**
    * This method
    * 
    * @param x
    *           - the horizontal coordinate to add the node
    * @param y
    *           - the vertical coordinate to add the node
    * @param value
    *           -
    */

   public void addNode(int x, int y, int value)
   {
      System.out.printf("" + x + " : " + y + "\n");
      this.matrix[x][y] = new Node(x, y, value);
   }

   /**
    * This method gets the maximum value of grey (grey scale)
    * 
    * @return - gets the maximum value of grey
    */

   public int getMaxGray()
   {
      return maxGray;
   }

   /**
    * This method sets the maximum value of grey (grey scale)
    * 
    * @param maxGrey
    *           - sets the maximum value of grey
    */

   public void setMaxGray(int maxGray)
   {
      this.maxGray = maxGray;
   }

   /**
    * This method gets the width of the map in pixels
    * 
    * @return returns the number of pixels of the map width
    */

   public int getWidth()
   {
      return width;
   }

   /**
    * This method gets the height of the map in pixels
    * 
    * @return returns the number of pixels of the map height
    */
   public int getHeight()
   {
      return height;
   }

}
